<?php
/**
 * Defines Kodform_Validator class
 *
 *
 * @copyright 	Copyright (c) 2006 Boris Tomic (kodmasin.net)
 * @category 	Kodform
 * @package 	Kodform
 * @author 		Boris Tomic
 * @license 	http://boris.kodmasin.net/kodform4:license The BSD License
 *
 */
/**
 * base Validator class
 * 
 * every validator should extend this class
 */
abstract class Kodform_Validator{
	private $error;
	/**
	* constructor which takes error message as paramatar. This error message
	* will be used if value is not valid. 
	*/
	public function __construct($error){
		$this->error = $error;
	}
	/**
 	 * abstract method which do validation
 	 * 
	 * this methos should be overloaded to implement validation
	 */
	abstract public function validate($value);
	/**
	 * returns validation error
	 * 
	 * this function will return error eaven if value is valid.
	 */
	public function getError(){
		return $this->error;
	}
}